<?php
/**
 * Created by PhpStorm.
 * User: chengenghong
 * Date: 2021-09-14
 * Time: 11:53
 */

namespace G244\Factory;


class PHPRenderer implements  TemplateRenderer
{
    public function render(string $templateString, array $arguments = []): string
    {
        extract($arguments);

        ob_start();
        eval(' ?>' . $templateString . '<?php ');
        $result = ob_get_contents();
        ob_end_clean();

        return $result;
    }

}
